var _cached = {};

var Cached = {
  fetch(key) {
    if(Cached.has(key)) {
      return _cached[key];
    }
    return null;
  },
  save(key, data) {
    _cached[key] = data;
  },
  has(key) {
    return _cached.hasOwnProperty(key);
  },
  remove(key) {
    delete _cached[key];
  }
};

module.exports = Cached;
